﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="AgregarActividadesFrm.aspx.cs" Inherits="ddcCajamarca.Web.AgendaCultural.AgregarActividadesFrm" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    
    <script src="../Scripts/bootstrap.js"></script>
    <script src="../Scripts/bootstrap.min.js"></script>

    <div class="col-xs-12">
        <div class="panel panel-primary">
            <div class="panel panel-heading">
                <div class="row">
                    <div class="col-sm-9">
                        <h3><b>Agregar Actividades</b></h3>
                    </div>
                </div>
            </div>

            <div class="panel-body">
                
                <asp:UpdatePanel ID="upActividades" runat="server">
                    <ContentTemplate>
                        <%--Collapse Datos del Evento--%>
                        <button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#collapseAddAct" aria-expanded="false" aria-controls="collapseAddAct">
                            Agregar Actividades
                        </button>
                        <div class="collapse" id="collapseAddAct">
                            <div class="well">
                                <div class="row">
                                    <div class="col-md-8">
                                        <label>Nombre:</label>
                                        <asp:Label ID="lblName" Text="" Font-Bold="True" Font-Italic="False" Font-Names="Times New Roman" Font-Size="X-Large" runat="server" />
                                    </div>
                                    <div class="col-sm-2">
                                        <label>Nro. Actividades:</label>
                                        <asp:TextBox ID="tbxCantidad" placeholder="Ejm: 4" CssClass="form-control input-sm num" runat="server" />
                                        <asp:RequiredFieldValidator ID="rfvCantidad" runat="server" ControlToValidate="tbxCantidad" ErrorMessage=" Ingresa Cantidad" ForeColor="Red"></asp:RequiredFieldValidator>
                                    </div>
                                    <div class="col-lg-2">
                                        <br />
                                        <asp:Button ID="btnAgregar" Text="Agregar" CssClass="btn btn-info" runat="server" OnClick="btnAgregar_Click" />
                                    </div>
                                </div>
                            </div>
                        </div>
                        <%--/Collapse Datos del Evento--%>

                        <%--Start ListView--%>
                        <asp:ListView ID="lvActividades" runat="server"
                            ItemType="ddcCajamarca.BusinessEntities.AgendaCultural.ActividadEvento">
                            <EmptyDataTemplate>
                            </EmptyDataTemplate>
                            <ItemTemplate>

                                <div class="panel panel-default">

                                    <%--Start panel-heading--%>
                                    <div class="panel panel-heading">
                                        <div class="row">
                                            <div class="col-sm-9">
                                                <h4><b>Actividad</b></h4>
                                            </div>
                                        </div>
                                    </div>
                                    <%--End panel-heading--%>

                                    <%--Start panel-body--%>
                                    <div class="panel-body">
                                        <div class="row">
                                            <div class="col-md-12">
                                                <label>Nombre:</label>
                                                <asp:TextBox ID="tbxNameActividad" Text="<%# Bind('Nombre') %>" CssClass="form-control input-sm" runat="server" placeholder="Ej: Presentacion de Libro" MaxLength="500" />
                                                <asp:RequiredFieldValidator ID="rfvNomActividad" runat="server" ControlToValidate="tbxNameActividad" ErrorMessage=" Campo necesario" ForeColor="Red"></asp:RequiredFieldValidator>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-6">
                                                <label>Lugar:</label>
                                                <asp:DropDownList ID="ddlLugarEvento" CssClass="form-control input-sm"
                                                    ItemType="ddcCajamarca.BusinessEntities.AgendaCultural.Ambiente"
                                                    SelectMethod="getAmbientes"
                                                    DataTextField="NombreAmbiente"
                                                    DataValueField="Id"
                                                    runat="server"
                                                    AutoPostBack="true">
                                                </asp:DropDownList>
                                            </div>
                                            <div class="col-md-2">
                                                <label>Fecha:</label>
                                                <asp:TextBox ID="tbxDia" Text="<%# Bind('Dia','{0:d}') %>" CssClass="form-control input-sm date" runat="server" MaxLength="10" placeholder="Ej: 03/09/1991" />
                                                <ajaxToolkit:CalendarExtender ID="aceDia"
                                                    runat="server" Enabled="True" TargetControlID="tbxDia"
                                                    Format="dd/MM/yyyy" TodaysDateFormat="dd/MM/yyyy">
                                                </ajaxToolkit:CalendarExtender>
                                                <asp:RequiredFieldValidator ID="rfvDia" runat="server" ControlToValidate="tbxDia" ErrorMessage=" Campo necesario" ForeColor="Red"></asp:RequiredFieldValidator>
                                            </div>
                                            <div class="col-md-2">
                                                <label>Hora Inicio:</label>
                                                <asp:TextBox ID="tbxHInicio" Text="<%# Bind('HInicio','{0:t}') %>" CssClass="form-control input-sm time" runat="server" placeholder="10.00 am" MaxLength="10" />
                                                <asp:RequiredFieldValidator ID="rfvHInicio" runat="server" ControlToValidate="tbxHInicio" ErrorMessage=" Campo necesario" ForeColor="Red"></asp:RequiredFieldValidator>
                                            </div>

                                            <div class="col-md-2">
                                                <label>Hora Fin:</label>
                                                <asp:TextBox ID="tbxHFin" Text="<%# Bind('HFin','{0:t}') %>" CssClass="form-control input-sm time" runat="server" placeholder="10.00 am" MaxLength="10" />
                                                <asp:RequiredFieldValidator ID="rfvHFin" runat="server" ControlToValidate="tbxHFin" ErrorMessage=" Campo necesario" ForeColor="Red"></asp:RequiredFieldValidator>
                                            </div>

                                        </div>
                                    </div>

                                    <%--End panel-body--%>
                                </div>
                                <%--End panel-primary--%>
                            </ItemTemplate>
                        </asp:ListView>
                        <%--End ListView--%>
                    </ContentTemplate>
                </asp:UpdatePanel>

            </div>
            <div class="modal-footer">
                <a class="btn btn-default" href="frmListarEventos.aspx">Cancelar</a>
                <asp:Button ID="btnGuardar" CssClass="btn btn-primary" Text="Guardar" runat="server" OnClick="btnGuardar_Click" />
            </div>
        </div>
    </div>
    
   
    <%-- Script TimePicker --%>
    <link rel="stylesheet" href="../Scripts/plugin/TimePicker/css/jquery-ui.css">
    <script src="../Scripts/plugin/TimePicker/js/jquery-1.11.0.js"></script>
    <script src="../Scripts/plugin/TimePicker/js/jquery-ui.js "></script>
    <script src="../Scripts/plugin/TimePicker/js/jquery-ui-timepicker-addon.js"></script>
    
    <script>
        $(function () {
            $('.time').timepicker({
                ampm: true,
                dateFormat: 'yy-mm-dd',
                timeFormat: 'hh:mm TT'
            });
        });
    </script>

    <%-- End Script --%>
    
    <script>
        $(document).ready(function () {

            //Para que solo ingrese numeros
            $('.num').keyup(function () {
                this.value = this.value.replace(/[^1-9]/g, '');
            });

            //Para validar que el campo de fecha solo acepte numeros y el /
            $('.date').keyup(function () {
                this.value = this.value.replace(/[^0-9/]/g, '');
            });

        });

    </script>
    
</asp:Content>
